﻿using IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class DbFactory
    {
        /// <summary>
        /// 数据库工厂
        /// </summary>
        /// <param name="dbtype"></param>
        /// <param name="strConnection"></param>
        /// <returns></returns>
        public static IDapperRepository Create(string dbtype, string strConnection = null)
        {
            IDapperRepository idal = null;

            if (dbtype == "mysql")
            {
                idal = new MsSqlDapperRepository(strConnection);
            }

            if (dbtype == "mssql")
            {
                idal = new MsSqlDapperRepository(strConnection);
            }
            return idal;

        }
    }
}
